///被适配器
class Adaptee {
  String conCreateOperator() {
    return 'Adapter';
  }
}

abstract class ITarget {
  String operator();
}

///对象适配器
class ObjectAdapter implements ITarget {
  var adapter = Adaptee();

  @override
  String operator() {
    return adapter.conCreateOperator();
  }
}

///类适配器
class ClassAdapter extends Adaptee {
  String operator() {
    return super.conCreateOperator();
  }
}

///客户端
class Client {
  Client(this.adapter);

  final ITarget adapter;

  operator() {
    var result = adapter.operator();
    assert(result == 'Adapter');
  }
}